/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.game.math.view.render;

import java.awt.Component;
import javax.swing.DefaultCellEditor;
import javax.swing.JTable;
import javax.swing.JTextField;

/**
 *
 * @author nmduc
 */
public class InputResultCellEditor extends DefaultCellEditor {

    private boolean setFont;

    public InputResultCellEditor(JTextField textField) {
        super(textField);
        setFont = false;
    }

    @Override
    public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
        Component component = super.getTableCellEditorComponent(table, value, isSelected, row, column);
        if (!setFont) {
            component.setFont(table.getFont());
            setFont = true;
        }
        return component;
    }
}
